#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import sys

from PyQt5.QtCore import QUrl, pyqtSlot
from PyQt5.Qt import QDialog, QApplication, Qt, QPalette
from PyQt5.QtQuickWidgets import QQuickWidget

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.Qt import Qt

from PyQt5.QtCore import pyqtSlot

class QmlWindow(QtWidgets.QWidget):
	def __init__(self, url):
		super(QmlWindow, self).__init__()

		self.qmlWindow = QQuickWidget(self)
		self.qmlWindow.setResizeMode(QQuickWidget.SizeRootObjectToView)
		self.qmlWindow.rootContext().setContextProperty("qmlWindow", self.qmlWindow)
		self.qmlWindow.setSource(QUrl(url))


		self.show()


#app_dir = os.path.realpath(app_dir)
#app = QApplication(sys.argv)
#w = QmlWindow("file:///media/G/qt/test2/qml/test2/main.qml")
		#app.setApplicationName("Health")

#sys.exit(app.exec_)